package com.lanyeo.liver.ui

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import com.lanyeo.liver.databinding.TaskResourceBinding

class SettingResource(context: Context) : ISetting {
    private var _binding: TaskResourceBinding? = null
    private val binding get() = _binding!!

    init {
        _binding = TaskResourceBinding.inflate(LayoutInflater.from(context))
    }
    override fun view(): View {
        return binding.root
    }

    override fun params(): Any {
        val selectActions = mutableSetOf<String>()
        if (binding.cbFastMove.isChecked) {
            selectActions.add(TAG_FAST_MOVE)
        }
        if (binding.cbDebug.isChecked) {
            selectActions.add(TAG_DEBUG)
        }
        if (binding.cbBaQi.isChecked) {
            selectActions.add(binding.cbBaQi.text.toString())
        }
        if (binding.cbKaiCai.isChecked) {
            selectActions.add(binding.cbKaiCai.text.toString())
        }
        if (binding.cbCaiKuang.isChecked) {
            selectActions.add(binding.cbCaiKuang.text.toString())
        }
        if (binding.cbFaMu.isChecked) {
            selectActions.add(binding.cbFaMu.text.toString())
        }
        if (binding.cbCaiJi.isChecked) {
            selectActions.add(binding.cbCaiJi.text.toString())
        }
        if (binding.cbSouXun.isChecked) {
            selectActions.add(binding.cbSouXun.text.toString())
        }
        if (binding.cbShiQu.isChecked) {
            selectActions.add(binding.cbShiQu.text.toString())
        }
        if (binding.cbHuiShou.isChecked) {
            selectActions.add(binding.cbHuiShou.text.toString())
        }
        return selectActions
    }

    companion object {
        const val TAG_FAST_MOVE = "FastMove"
        const val TAG_DEBUG = "Debug"
    }
}